iResult = GoSetup( m_hWnd, TRUE ); // TRUE specifie we will use FINISH.EXE to clean up the temp dir when setup is complete
// Test the GoSetup returned value
if ( iResult == SETUP_SUCCESSFUL )
{
if ( bCSetup )
{
if ( iLanguage == LANGUAGE_FRENCH )
test = MessageBox( "Souhaitez vous installer les icones\nde Setup Studio?", "Setup Studio", MB_YESNO | MB_ICONQUESTION );
else
test = MessageBox( "Do you wish to install Setup Studio icons?", "Setup Studio", MB_YESNO | MB_ICONQUESTION );
if ( test == IDYES )
{
CString IconPath;
// First icon is the Wizard Icon
IconPath = UserPath;
IconPath += "SSTUDIO.EXE";
if ( DoesFileExist( IconPath.GetBuffer(160), TRUE ) )
{
IconPath.ReleaseBuffer();
if ( iLanguage == LANGUAGE_FRENCH )
{
AddItemToProgman("Setup Studio 1.2", IconPath.GetBuffer(160), "Setup Studio Wizard",
"Le Wizard est un assistant pour gΘrer les fichiers. Pour l' utiliser vous devrez modifier ses fichiers PIF et les copier dans le rΘpertoire de Windows." );
IconPath.ReleaseBuffer();
}
else
{
IconPath.ReleaseBuffer();
AddItemToProgman("Setup Studio 1.2", IconPath.GetBuffer(160), "Setup Studio Wizard",
"Setup Studio Wizard is a tool to manage files an to create disks sets. To use it, you must edit PIF files and copy them in the Windows directory.");
IconPath.ReleaseBuffer();
}
ShowWindow(SW_SHOWNORMAL );
}
else
IconPath.ReleaseBuffer();
}
// User installs help files
if ( bHelp )
{
SrcHelpFile = UserPath;
if ( iLanguage == LANGUAGE_FRENCH )
SrcHelpFile += "FRSTUDIO.HLP" ;
else
SrcHelpFile += "USSTUDIO.HLP";
DestHelpFile = UserPath;
DestHelpFile += "SSTUDIO.HLP";
if ( DoesFileExist( DestHelpFile.GetBuffer(160), TRUE ) )
if ( IsFileName( TempDestName, FILENAME_DIRWITHSLASH, CHECK_ROOTDIRSEXIST) )
{
lstrcpy( UserPath, TempDestName );
CDialog::OnOK();
}
else
{
if ( iLanguage == LANGUAGE_FRENCH )
MessageBox( "Le rΘpertoire mentionnΘ n' est pas valide.\nSi vous avez mentionnΘ des sous rΘpertoires\nceux ci doivent exister.\n", "Setup Studio", MB_OK | MB_ICONEXCLAMATION );
else
MessageBox( "Directory name is not valid.\nIf you want to specifie sub directories\nthey must exist.\n", "Setup Studio", MB_OK | MB_ICONEXCLAMATION );
bConfiguration = TRUE; // Indicate we have made a selection
if ( IsDlgButtonChecked( IDC_CHECKBASIC ) ) // we save the current selection
bBasic = TRUE;
else
bBasic = FALSE;
if ( IsDlgButtonChecked( IDC_CHECKCSETUP )) // we save the current selection
bCSetup = TRUE;
else
bCSetup = FALSE;
if ( IsDlgButtonChecked( IDC_CHECKDEMO ) ) // we save the current selection
bDemo = TRUE;
else
bDemo = FALSE;
if ( IsDlgButtonChecked( IDC_CHECKHELP ) ) // we save the current selection
bHelp = TRUE;
else
bHelp = FALSE;
if ( IsDlgButtonChecked( IDC_CHECKWIZARD ) ) // we save the current selection
bWizard = TRUE;
else
bWizard = FALSE;
if ( IsDlgButtonChecked( IDD_CHECKSSETUP ) ) // we save the current selection
bSSetup = TRUE;
else
bSSetup = FALSE;
// Check available space
if ( bBasic ) ConfigurationSpace = GetSectionSize( "Basic" );
if ( bCSetup ) ConfigurationSpace += GetSectionSize( "CSetup" );
if ( bDemo ) ConfigurationSpace += GetSectionSize( "Demo" );
if ( bHelp ) ConfigurationSpace += GetSectionSize( "Help" );
if ( bWizard ) ConfigurationSpace += GetSectionSize( "Wizard" );
if ( bSSetup ) ConfigurationSpace += GetSectionSize( "CTL3D" );
if ( ConfigurationSpace > AskForDriveSpace( GetDriveNumber( UserPath )) )
{
if ( iLanguage == LANGUAGE_FRENCH )
MessageBox("Il n' y a pas assez d' espace libre\nsur l' unitΘ destination pour installer\nla sΘlection que vous avez choisi.\n\nVeuillez modifier votre sΘlection\nou changer de rΘpertoire."
, "Setup Studio", MB_OK | MB_ICONEXCLAMATION );
else
MessageBox("There is not enough free space\nto install selected files.\n\nPlease, change your selection\nor destination directory."